<?php

/**
 * Test: ArrayList and extension method.
 *
 * @author     David Grudl
 * @category   Nette
 * @package    Nette\Collections
 * @subpackage UnitTests
 */



require dirname(__FILE__) . '/../initialize.php';

require dirname(__FILE__) . '/Collections.inc';



function ICollection_prototype_join(ICollection $that, $separator)
{
	return implode($separator, (array) $that);
}$list = new ArrayList(NULL, 'Person');

$list[] = new Person('Jack');
$list[] = new Person('Mary');
$list[] = new Person('Larry');

T::dump( $list->join(', ') );

// undeclared method
try {
	$list->test();

} catch (Exception $e) {
	T::dump( $e );
}



__halt_compiler() ?>

------EXPECT------
string(17) "Jack, Mary, Larry"

Exception MemberAccessException: Call to undefined method %ns%ArrayList::test().
